import request from '@/utils/request'

// 查询听证申请列表
export function listHearingRequest(query) {
  return request({
    url: '/ruoyi-system/hearingrecord/list',
    method: 'get',
    params: query,
  })
}

// 查询听证申请审批详细
export function getHearingRequest(id) {
  return request({
    url: '/ruoyi-system/hearingrecord/' + id,
    method: 'get',
  })
}

// 新增听证申请审批
export function addHearingRequest(data) {
  return request({
    url: '/ruoyi-system/hearingrecord',
    method: 'post',
    data: data,
  })
}

// 修改听证申请审批
export function updateHearingRequest(data) {
  return request({
    url: '/ruoyi-system/hearingrecord',
    method: 'put',
    data: data,
  })
}

// 删除听证申请审批
export function delHearingRequest(id) {
  return request({
    url: '/ruoyi-system/hearingrecord/' + id,
    method: 'delete',
  })
}

// 预览

export function previewHearingRequest(params) {
  return request({
    url: '/ruoyi-system/hearingrecord/preview',
    method: 'get',
    params,
  })
}

// 保存附件
export function addHearingRequestFiles(data) {
  return request({
    url: '/ruoyi-system/hearingrecord/addFiles',
    method: 'post',
    data,
  })
}

// 导出
export function exportHearingRequest(data) {
  return request({
    url: '/ruoyi-system/hearingrecord/export',
    method: 'post',
    data,
    responseType: 'blob',
  })
}

// 立案号下拉
export function getCaseList() {
  return request({
    url: '/ruoyi-system/hearingrecord/caseList',
    method: 'get',
  })
}

export function getContent(id) {
  return request({
    url: '/ruoyi-system/hearingrecord/getContent?caseId=' + id,
    method: 'get',
  })
}

export function previewPdf(data) {
  return request({
    url: '/ruoyi-system/hearingrecord/pdfPreview?caseId',
    method: 'post',
    data,
  })
}
